.editor {
  width: 100%;
}

/* 支持自动高度调整 */
.editor :global(.w-md-editor) {
  min-height: 200px;
}

.editor :global(.w-md-editor-text-area) {
  min-height: 200px !important;
  resize: vertical;
}

.editor :global(.w-md-editor-text),
.editor :global(.w-md-editor-preview) {
  min-height: 200px;
}

.editor :global(.w-md-editor) {
  -ms-high-contrast: none !important;
}

.editor[data-mode='edit'] :global(.w-md-editor) {
  box-shadow: none !important;
  border: 1px solid #d9d9d9 !important;
  border-radius: 2px;
}

.editor[data-mode='edit'] :global(.w-md-editor):hover {
  border-color: #4096ff !important;
}

.editor[data-mode='edit'] :global(.w-md-editor-focused) {
  border-color: #4096ff !important;
  box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2) !important;
}

/* 预览模式样式 */
.editor[data-mode='preview'] :global(.w-md-editor) {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  height: auto !important;
  min-height: auto !important;
}

.editor[data-mode='preview'] :global(.w-md-editor-toolbar) {
  display: none !important;
}

.editor[data-mode='preview'] :global(.w-md-editor-content) {
  height: auto !important;
  min-height: auto !important;
  overflow: visible !important;
}

.editor[data-mode='preview'] :global(.w-md-editor-preview) {
  padding: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  height: auto !important;
  min-height: auto !important;
  position: static !important;
  overflow: visible !important;
  border: none !important;
}

.editor[data-mode='preview'] :global(.wmde-markdown) {
  background: transparent !important;
  height: auto !important;
  min-height: auto !important;
  overflow: visible !important;
}

.readOnlyEditor {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
}

.readOnlyEditor :global(.w-md-editor) {
  height: auto !important;
  min-height: auto !important;
}

.readOnlyEditor :global(.w-md-editor-toolbar) {
  display: none !important;
}

.readOnlyEditor :global(.w-md-editor-content) {
  height: auto !important;
  min-height: auto !important;
  overflow: visible !important;
}

.readOnlyEditor :global(.w-md-editor-preview) {
  padding: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  height: auto !important;
  min-height: auto !important;
  position: static !important;
  overflow: visible !important;
}

.readOnlyEditor :global(.wmde-markdown) {
  background: transparent !important;
  height: auto !important;
  min-height: auto !important;
  overflow: visible !important;
}

/* 确保所有嵌套容器都能自适应高度 */
/* 注释掉会阻止编辑的样式 */
/*
.editor :global(.w-md-editor-text),
.editor :global(.w-md-editor-text-pre),
.editor :global(.w-md-editor-text-input) {
  display: none !important;
}
*/

/* 图片样式 */
.editor :global(.wmde-markdown img) {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 8px 0;
}

.editor :global(.w-md-editor-preview) img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 8px 0;
}

/* 数学公式样式 */
.editor :global(.katex-display) {
  margin: 1em 0;
  text-align: center;
}

.editor :global(.katex) {
  font-size: 1.2em;
} 